<?php

declare(strict_types=1);

namespace App\Model\PssModel;
use App\Model\BaseModel\BasePssModel;
/**
 * 渠道用户表
 * @author chenshubo
 */
class Business extends BasePssModel
{
    protected $table = 'business';
    
    //指定写入字段
    protected $fillable = [
        
    ];
    
    //指定字段展示类型
    protected $casts = [
        'id' => 'string',
    ];
    
    /**
     * 获取用户信息
     * @param array $bid
     */
    public function getUserInfoByBids( array $bids = [] )
    {
        return $this
        ->select([
            'id',
            'id as bid',
            'open_url',
            'is_push_goods',
            'account',
            'is_mult_shop',
            'user_tag',
            'is_market_price_send',
            'is_not_push_express',
            'is_router_user',
            'is_channel',
            'is_child_yc',
            'channel_id',
            'template_price_tpl'
        ])
        ->whereIn('id',$bids)
        ->where('has_template',1)
        ->get()
        ->toArray();
    }
}